﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Web;
using System.Web.Hosting;

namespace Symbonix.NorSoNet.Framework
{
    public class TestBase
    {
        protected TestBase()
        {
            LoadHttpContext();
        }

        protected void LoadHttpContext()
        {
            string currentDirectory = Directory.GetCurrentDirectory();
            string workingDirectory = new DirectoryInfo(currentDirectory).Parent.Parent.Parent.FullName;

            TextWriter tw = new StringWriter();
            HttpWorkerRequest wr = new SimpleWorkerRequest("/NoSoNet-Web", workingDirectory + "\\NoSoNet-Web\\", "default.aspx", "", tw);
            HttpContext.Current = new HttpContext(wr);
        }
    }
}
